<%--
  Created by IntelliJ IDEA.
  User: lixin
  Date: 2022/12/23
  Time: 8:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户注册</title>

</head>
<body>

    <c:set var="path" value="<%=request.getContextPath()%>"></c:set>

    <form action="${path}/register" method="post">
        <table id="registerInfo" align="center">
            <caption>用户注册</caption><br/>
            <tr>
                <td>用户名</td>
                <td>
                    <input type="text" name="username" id="username">
                </td>
            </tr>
            <tr>
                <td>密码</td>
                <td>
                    <input type="password" name="password" id="password">
                </td>
            </tr>
            <tr>
                <td>联系方式</td>
                <td>
                    <input type="tel" name="phoneNum" id="phoneNum">
                </td>
            </tr>
            <tr>
                <td>角色</td>
                <td>
                    <input type="radio" name="role" value="普通用户" checked>普通用户
                    <input type="radio" name="role" value="管理员">管理员
                </td>
            </tr>
            <tr>
                <td>专业</td>
                <td>
                    <select name="major">
                        <option value="计算机科学与技术">计算机科学与技术</option>
                        <option value="软件工程">软件工程</option>
                        <option value="电子商务">电子商务</option>
                        <option value="大数据">大数据</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td><input type="submit" value="注册"></td>
                <td align="center">
                    <c:choose>
                        <c:when test="${info eq \"注册成功\"}">
                            <span style="color: green">${info}</span>
                        </c:when>
                        <c:when test="${info eq \"注册失败\"}">
                            <span style="color: red">${info}</span>
                        </c:when>
                        <c:otherwise>
                            <span style="color:blue">${info}</span>
                        </c:otherwise>
                    </c:choose>
                </td>
            </tr>

        </table>
    </form>

</body>
</html>
